package com.elong.businesstravel.protocol.hotel;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.apache.http.HttpEntity;
import org.apache.http.entity.StringEntity;
import org.json.JSONObject;

import android.content.Context;

import com.android.support.jhf.network.loopj.android.http.RequestParams;
import com.elong.businesstravel.base.mcrypt.MCrypt;
import com.elong.businesstravel.include.Version;
import com.elong.businesstravel.protocol.ProtocolDef;
import com.elong.businesstravel.protocol.baserequest.BaseELongHttpRequest;
/**
 * 获取酒店价格列表
 * @author lenovo
 *
 */
public class GetHotelPriceRequest extends BaseELongHttpRequest {
	
//	private String requestParamString;

	// $aRule['/app/service/getdtailelong'] = array(
	// 'version' => array ('type' => 'float'),
	// 'debug' => array ('type' => 'string','mast' => 'N'),
	// 'hotelid' => array ('type' => 'string'),
	// 'uid' => array ('type' => 'number','mast' => 'N'),
	// 'startdate' => array ('type' => 'string'),
	// 'enddate' => array ('type' => 'string'),
	// 'paytype'=> array ('type' => 'enum', 'options'
	// =>array("All","Prepay","Selfpay"),'mast' => 'N'),
	// 'deviceid' => array ('type' => 'string','mast' => 'N'),
	// 'token' => array ('type' => 'string','mast' => 'N'),
	// 'callback' => array ('type' => 'string','mast' => 'N')
	// );
	
	public GetHotelPriceRequest(Context context, String hotelid, String startdate, String enddate, String paytype) {
		super(context);
		try {
			JSONObject jsonObject = new JSONObject();
			jsonObject.put("hotelid", hotelid);
			jsonObject.put("startdate", startdate);
			jsonObject.put("enddate", enddate);
			jsonObject.put("paytype", paytype);
			setRequestActionParam(ProtocolDef.ACTION_GetHotelPrice, jsonObject);
//			RequestParams requestParams = new RequestParams();
//			requestParams.add("action", URLEncoder.encode(
//					ProtocolDef.ACTION_GetHotelPrice, getEncoding()));
//			requestParams.add("req",
//					URLEncoder.encode(jsonObject.toString(), getEncoding()));
//
//			MCrypt mCrypt = new MCrypt();
//			requestParamString = MCrypt.bytesToHex(mCrypt.encrypt(requestParams
//					.toString()));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

//	@Override
//	public HttpEntity getRequestEntity() {
//		HttpEntity httpEntity = null;
//		try {
//			httpEntity = new StringEntity(requestParamString);
//		} catch (UnsupportedEncodingException e) {
//			e.printStackTrace();
//		}
//		
//		return httpEntity;
//	}

}
